Module-level declarations

Types

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
function map_vote(vote: vote): mapped_vote

Queries

Link copied to clipboard
@mount("votes.get_vote_of_citizen_by_proposal") query get_vote_of_citizen_by_proposal(account_id: byte_array, prop_id: rowid): mapped_vote?

Retrieves the vote cast by a specific citizen for a given proposal. The query is used to determine the voting record of a citizen for a specific proposal.

Link copied to clipboard
@mount("votes.get_votes_by_proposal") query get_votes_by_proposal(page_cursor: text, prop_id: rowid): paged_result

Retrieves a paginated list of votes for a specific proposal. The query is used to fetch and navigate through the votes tied to a particular proposal in the paginated format.

Link copied to clipboard
@mount("votes.get_votes_sorted_by_created_at") query get_votes_sorted_by_created_at(page_cursor: text, sort_direction: text, prop_id: rowid, account_id: byte_array?, filter_state: text): paged_result

Retrieves a paginated and sorted list of votes for a specific proposal. The query is used to fetch, sort, and navigate through votes for a proposal.

Link copied to clipboard
@mount("votes.get_votes_sorted_by_vote_power") query get_votes_sorted_by_vote_power(page_cursor: text, sort_direction: text, prop_id: rowid, account_id: byte_array?, filter_state: text): paged_result

Retrieves a paginated and sorted list of votes for a specific proposal, ordered by vote power. The query is used to fetch, sort, and navigate through votes based on their vote power.

Operations

Link copied to clipboard
@mount("votes.approve_or_disapprove_proposal") operation approve_or_disapprove_proposal(proposal_id: rowid, is_approve: boolean)

Approves or disapproves a specific proposal based on the citizen's decision.

Link copied to clipboard
@mount("votes.approve_or_disapprove_veto") operation approve_or_disapprove_veto(veto_id: rowid, is_approved: boolean)

Approves or disapproves a veto based on the citizen's decision.

Link copied to clipboard
@mount("votes.create_veto_for_proposal") operation create_veto_for_proposal(proposal_id: rowid, proposed_option_item_id: rowid)

Creates a veto for a specific proposal and option.

Link copied to clipboard
@mount("votes.finalize_veto") operation finalize_veto(veto_id: rowid)

Finalizes the specified veto if it meets the required conditions.

Link copied to clipboard
@mount("votes.finish_voting_on_proposal") operation finish_voting_on_proposal(proposal_id: rowid)

Ends the voting process for a specific proposal. The operation is used to finalize the voting process and prevent further voting on the specified proposal.

Link copied to clipboard
@mount("votes.update_veto_config") operation update_veto_config(veto_period: integer, vetoable_duration: integer)

Updates the veto configuration, including the veto period and vetoable duration.

Link copied to clipboard
@mount("votes.vote_on_proposal") operation vote_on_proposal(option_item_id: rowid, lock_amount: big_integer)

Allows a citizen to vote on a proposal option.